# coding:utf-8

class NewError(Exception):
    """
    自定义异常类
    """

    def __init__(self, message: str = ''):
        self.message = message


def test():
    raise NewError('this is a bug')


try:
    test()
except Exception as e:
    print(e)

# 断言
# try:
assert 1 > 2, "1不大于2"
# except AssertionError as e:
#     print(e)